package main

import (
	"fmt"
	"sync"
)

type DB struct {
	DbDns string
}

//func InitDb(DbDns string) *DB {
//	return &DB{DbDns: DbDns}
//}

var db *DB
var once sync.Once

func GetDb() *DB {
	once.Do(func() {
		db = &DB{DbDns: "127.0.0.12.9:3306"}
	})

	return db
}

func main() {
	d := GetDb()
	fmt.Printf("%p, %v\n ", d, d.DbDns)
	fmt.Println(d, d.DbDns)
}
